1. Field Of The Invention
The present invention relates to a transactional file system for updating files in response to requests for operations with respect to files.
2. Description Of The Background Art
In general, the information system executes a necessary processing and returns a processing result in response to a processing request received from a terminal device or a network. Such a flow for executing a processing that is activated somehow will be referred to as a transaction. A processing of such an information system will be referred to as a transaction processing and a system for carrying out the transaction processing will be referred to as a transaction processing system.
In the transaction processing system, various data are read out and their contents are modified or new data are written according to the needs in a process of the transaction processing. Such a data update should not be lost due to fault or the like after the transaction is committed, that is, after the transaction is completed normally and its processing result is returned. Conversely, when the transaction cannot be completed normally due to fault or error in a process of the processing, the consistency of data should be maintained by aborting the transaction, that is, by cancelling data updates made up to that point. There is a need to manage transactions such that these requirements are satisfied even when a plurality of transactions are to be processed in parallel concurrently.
In the conventional transaction processing system, a database management system is provided on a file system of a computer for executing transactions, and data to be updated by the transactions are accessed through the database management system so as to satisfy these requirements in the transaction processing system. A method for realizing the transaction processing system in this manner is already well known.
In general, an operating system is provided on a general purpose computer and the operating system has a file system for managing files. Application programs will be recording data in various complex structures using files.
As a method for constructing a file system that is robust with respect to faults, a method called journaling or logging has been used. In this method, in the case of modifying meta information of a file system, that is position information of files recorded on a stable memory device such as hard disk or information for region management such as bit map or the like, its change (difference) is collectively written as a log (or journal) in a continuous region on the stable memory device, and thereafter that change is actually applied to the meta information on the hard disk. As the meta information that is changed by the operations of the files is sequentially written into the log so that a state of the file system can be recovered quickly at a time of the re-activation after the occurrence of the fault, by reading out the log from a position memorized in advance and reflecting the change of the meta information in the meta information.
There is also a log structure file system in which the log contains not just the meta information of files but also content information of files, that is data that are written into files by user programs, and the content information and the meta information are all managed to be present only in the log.
In the system for carrying out the transaction processing in which transactions update a plurality of data, target data are conventionally managed by the database management system. However, the database management system can only handle data of specific type such as tables by a specific access method, which imposes severe limitations on a way of developing programs for transaction processing.
Nowadays various transaction processing requests are exchanged through the Internet and data having various complex structures such as document data, multimedia data, design data, catalog data, e-commerce data, etc., are frequently used, so that it is becoming quite impossible to realize the transaction processing efficiently by simply using the database management system as have been done conventionally.
On the other hand, the file system can handle highly general and flexible data called files. In particular the file system using journal or log has an excellent property from a viewpoint of robustness with respect to faults. However, the file system provided by the operating system of the general purpose computer does not manage a state of file update by individual transaction so that it is impossible to realize the atomic updating, that is maintaining and managing the file system in a consistent state according to whether an update of each transaction is to be committed or aborted.
It is therefore an object of the present invention to provide a transactional file system which is capable of realizing atomic update of plural files by transactions.
According to one aspect of the present invention there is provided a transactional file management method, comprising the steps of: (a) generating a log entry containing an information for validating all updates made by a transaction collectively on a stable memory device, for one or more files updated on a buffer region by the transaction since a start of a processing of the transaction until a commit of the transaction; and (b) writing the log entry into the stable memory device at a time of the commit of the transaction.
According to another aspect of the present invention there is provided a transactional file system for managing files stored in a stable memory device and providing the files to processings by transactions, comprising: a log entry generation unit configured to generate a log entry containing an information for validating all updates made by a transaction collectively on a stable memory device, for one or more files updated on a buffer region by the transaction since a start of a processing of the transaction until a commit of the transaction; and a log entry writing unit configured to write the log entry into the stable memory device at a time of the commit of the transaction.
According to another aspect of the present invention there is provided a composite transactional file system formed by a plurality of transactional file systems for managing files stored in a stable memory device and providing the files to processings by transactions, each transactional file system comprising: a log entry generation unit configured to generate a log entry containing an information for validating all updates made by a transaction collectively on a stable memory device, for one or more files updated on a buffer region by the transaction since a start of a processing of the transaction until a commit of the transaction; and a log entry writing unit configured to write the log entry into the stable memory device at a time of the commit of the transaction; wherein when one transaction updates a plurality of files in more than one transactional file systems, the log entry generation unit of each transactional file system generates the log entry containing said information for one or more files updated by said one transaction in said each transactional file system, and the log entry writing unit of each transaction file system writes the log entry into the stable memory device corresponding to said each transactional file system by embedding another information for identifying another log entry for said one transaction that is generated in another transactional file system, into the log entry.
According to another aspect of the present invention there is provided a computer usable medium having computer readable program codes embodied therein for causing a computer to function as a transactional file system for managing files stored in a stable memory device and providing the files to processings by transactions, the computer readable program codes include: a first computer readable program code for causing said computer to generate a log entry containing an information for validating all updates made by a transaction collectively on a stable memory device, for one or more files updated on a buffer region by the transaction since a start of a processing of the transaction until a commit of the transaction; and a second computer readable program code for causing said computer to write the log entry into the stable memory device at a time of the commit of the transaction.
Other features and advantages of the present invention will become apparent from the following description taken in conjunction with the accompanying drawings.